package snakesladders.visual;

import java.awt.Point;

import javax.swing.JTextField;

import minidraw.framework.Drawing;
import minidraw.framework.DrawingEditor;
import minidraw.framework.DrawingView;
import minidraw.framework.Factory;
import minidraw.framework.Figure;
import minidraw.standard.ImageFigure;
import minidraw.standard.MiniDrawApplication;
import minidraw.standard.SelectionTool;
import minidraw.standard.StandardDrawing;
import minidraw.standard.StdViewWithBackground;

public class ShowLayout {

	public static void main(String[] args) {
		DrawingEditor editor = new MiniDrawApplication("Show layout", new SnakesAndLaddersFactory1() );
		
		editor.open();
		
		Figure die = new ImageFigure("die4", new Point(690, 40));
				
		editor.drawing().add(die);

		editor.setTool(new SelectionTool(editor));
	}

}

class SnakesAndLaddersFactory1 implements Factory {
	@Override
	public DrawingView createDrawingView(DrawingEditor editor) {

		DrawingView view = new StdViewWithBackground(editor, "snakes-and-ladders-background");
		return view;
	}
	
	@Override
	public Drawing createDrawing(DrawingEditor editor) {
		return new StandardDrawing();
	}

	@Override
	public JTextField createStatusField(DrawingEditor arg0) {
		JTextField statusField = new JTextField("Hello snakes....");
		statusField.setEditable(false);
		return statusField;
	}
	
}